package net.cyndeline.fov.mrpas

/**
 * Responsible for dividing an obstacle tile map up into four quadrants (using the
 * map starting position as center), then parsing each line of tiles from the border
 * orthogonal to the start position in each quadrant into a line. 
 * 
 * The start position itself is not included in any line.
 * 
 */
trait LineParser {
  
  /**
   * Returns a quadruple containing the four quadrants that the map is divided into.
   * The order is: Upper Left, Upper Right, Lower Left, Lower Right.
   */
  def generateQuadrants(mapPosition: (Int, Int), map: Array[Array[Int]], radius: Int): (Quadrant, Quadrant, Quadrant, Quadrant)
  
  /**
   * Parses a single upper left quadrant. 
   */
  def parseUpperLeftQuadrant(mapPosition: (Int, Int), map: Array[Array[Int]], radius: Int): Quadrant
  
  /**
   * Parses a single upper right quadrant. 
   */
  def parseUpperRightQuadrant(mapPosition: (Int, Int), map: Array[Array[Int]], radius: Int): Quadrant
  
  /**
   * Parses a single lower left quadrant. 
   */
  def parseLowerLeftQuadrant(mapPosition: (Int, Int), map: Array[Array[Int]], radius: Int): Quadrant
  
  /**
   * Parses a single lower right quadrant. 
   */
  def parseLowerRightQuadrant(mapPosition: (Int, Int), map: Array[Array[Int]], radius: Int): Quadrant
}